package com.igbeok.miscellaneous.concurrency.hemberg;

public class HambergShop {

    Waiter waiter = new Waiter();
    HambergFifo hambergPool = new HambergFifo();
    Customer c1 = new Customer(waiter, hambergPool);
    Customer c2 = new Customer(waiter, hambergPool);
    Customer c3 = new Customer(waiter, hambergPool);
    Cooker cooker = new Cooker(waiter, hambergPool);

    public static void main(String[] args) {
        HambergShop hambergShop = new HambergShop();
        Thread t1 = new Thread(hambergShop.c1, "Customer 1");
        Thread t2 = new Thread(hambergShop.c2, "Customer 2");
        Thread t3 = new Thread(hambergShop.c3, "Customer 3");
        Thread t4 = new Thread(hambergShop.cooker, "Cooker 1");
        Thread t5 = new Thread(hambergShop.cooker, "Cooker 2");
        Thread t6 = new Thread(hambergShop.cooker, "Cooker 3");
        t4.start();
        t5.start();
        t6.start();
        try {
            Thread.sleep(10000);
        } catch (Exception e) {
        }

        t1.start();
        t2.start();
        t3.start();
    }
}
